package com.grj.spring.service;


import com.grj.spring.annotation.Autowired;
import com.grj.spring.annotation.PostConstruct;
import com.grj.spring.config.BeanNameAware;
import com.grj.spring.config.Initialization;
import com.grj.spring.annotation.Component;

/**
 * @author 14505
 */
@Component
public class UserService implements BeanNameAware, Initialization {

    private String beanName;

    @PostConstruct
    public void init(){
        System.out.println("userService init");
    }

    @Autowired
    private OrderService orderService;
    public String sayHello() {
        return "Hello ";
    }

    public void down() {
        orderService.down();
    }

    @Override
    public void setBeanName(String name) {
        this.beanName = name;
    }

    @Override
    public void afterPropertiesSet() {
        System.out.println("userService 初始化执行了");
    }
}
